package net.thermetics.fx.services;

import java.util.List;

import com.google.appengine.api.datastore.Key;

import net.thermetics.fx.auth.GaeUser;

/**
 * Interface that specifies the user service.
 * @author projectmoon
 *
 */
public interface UserService {
	/**
	 * Returns a list of all users.
	 * @return All users in the datastore.
	 */
	public List<GaeUser> getAllUsers();
	
	/**
	 * Gets a user based on user ID.
	 * @param userID
	 * @return A User object if one is found, null otherwise.
	 */
	public GaeUser getUser(String userID);
	
	/**
	 * Gets a user by App Engine key.
	 * @param key
	 * @return The user object if found.
	 */
	public GaeUser getUser(Key key);

	/**
	 * Updates the specified user.
	 * @param user
	 * @return True if the update was successful, or false if it failed for some reason.
	 */
	public boolean updateUser(GaeUser user);
	
	/**
	 * Deletes the user with the specified userID.
	 * @param userID
	 * @return True if successful, false if the delete failed or the user doesn't exist.
	 */
	public boolean deleteUser(String userID);
}
